<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../include/header.jsp" %>    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	<table border="1" style="border:solid black;  width: 100%; height: ; ">
		<tr style="height:20px; color: white; background-color: black; ">
			<th>IDX</th>
			<th>상태</th>
			<th>작성일</th>
			<th>강좌일</th>
			<th>강사명</th>
			<th>제목</th>
			<th>레시피</th>
			<th>수강(명)</th>
			<th>수강료</th>
			<th>수익금</th>			
			<th></th>			
		</tr>
		<c:forEach var="row" items="${map.list}">
		<tr style="height:15px; ">
			<td>${row.idx }</td>
			<th>
				<c:choose>
					<c:when test="${row.state =='0' }">
						<font color="purple">승인대기</font>
					</c:when>
					<c:when test="${row.state =='1' }">
						<font color="green">개설완료</font>
					</c:when>
					<c:when test="${row.state =='2' }">
						<font color="blue">강좌종료</font>
					</c:when>
					<c:when test="${row.state =='3' }">
						<font color="red">폐강</font>
					</c:when>				
				</c:choose>
			</th>
			<td>${row.post_date }</td>
			<td>${row.class_date }</td>
			<td>${row.userid }</td>
			<td><a href="${path }/class1/class1_detail.do?idx=${row.idx}">
			${row.subject }</a>
			</td>
			<td>${row.recipe_idx1 } & ${row.recipe_idx2 } </td>
			<td>${row.cnt }/10</td>
			<th>${row.price }</th>
			<th>${row.money }</th>	
			<th>				
				<c:choose>
					<c:when test="${row.state =='0' }">						
						<input type="button" value="자세히" 
						onclick="location.href='${path}/class1/class1_detail.do?idx=${row.idx }';">
						<input type="button" value="폐강" onclick="class_close('${row.idx}')"/>
					</c:when>
					<c:when test="${row.state =='1' }">						
						<input type="button" value="폐강" onclick="class_close('${row.idx}')"/>
						<font color="red" >${row.flag }</font>
					</c:when>
					<c:when test="${row.state =='2' }">
						<input type="button" value="정산" onclick="class_send('${row.idx}')"/>
					</c:when>
					<c:when test="${row.state =='3' }">
						<input type="button" value="환불" onclick="class_return('${row.idx}')"/>
					</c:when>				
				</c:choose>				
			</th>			
		</tr>
		</c:forEach>		
	</table>	
</body>
</html>